/**
* Copyright @ 2023 iAuto (Shanghai) Co., Ltd.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are NOT permitted except as agreed by
* iAuto (Shanghai) Co., Ltd.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/



import { Table } from 'antd'
// import type { ColumnsType } from 'antd/es/table'
import React from 'react'


interface DataType {
    dataType: string | null,
    defValue: string | null,
    desc: string | null,
    direct: null | any,
    name: string | null,
    paramId: string | null
}
interface ArgData {
    data: DataType[] | any;
}

const ArgTable: React.FC<ArgData> = (props) => {
    const { data } = props
    const columns: any = [
        {
            title: '参数名称',
            dataIndex: 'name',
            key: 'name'
        },
        {
            title: '数据类型',
            dataIndex: 'dataType',
            key: 'dataType'
        },
        {
            title: '默认值',
            dataIndex: 'defValue',
            key: 'defValue'
        },
        {
            title: '前端展示名称',
            dataIndex: 'desc',
            key: 'desc'
        }
    ]
    return (
        <div>
            <Table columns={columns} dataSource={data} pagination={false} rowKey='paramId' />
        </div>
    )
}

export default ArgTable